package org.example.pms.service.impl;

import org.example.pms.domain.EpitopeDetectionResult;
import org.example.pms.mapper.EpitopeDetectionResultMapper;
import org.example.pms.service.EpitopeDetectionResultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EpitopeDetectionResultServiceImpl implements EpitopeDetectionResultService {

    @Resource
    EpitopeDetectionResultMapper epitopeDetectionResultMapper;

    @Override
    public EpitopeDetectionResult getEpitopeDetectionResultById(Integer id) {
        EpitopeDetectionResult epitopeDetectionResult = epitopeDetectionResultMapper.selectById(id);
        return epitopeDetectionResult;
    }

    @Override
    public List<EpitopeDetectionResult> getEpitopeDetectionResultsByPatientId(Integer patientId) {
        List<EpitopeDetectionResult> epitopeDetectionResults = epitopeDetectionResultMapper.selectByPatientId(patientId);
        return epitopeDetectionResults;
    }

    @Override
    public Integer addEpitopeDetectionResult(EpitopeDetectionResult epitopeDetectionResult) {
        Integer insert = epitopeDetectionResultMapper.insert(epitopeDetectionResult);
        return epitopeDetectionResult.getId();
    }
}
